import { PERSONCENTERS_DATAS } from "../../Action/entrance/entrance";
import { PAYMENT_DATAS } from "../../Action/entrance/entrance";
import { PAGESOURCE_ID } from "../../Action/entrance/entrance";
import objectAssign from "object-assign";
//获取设备信息
const personCenterInfo = {
	totalAmt: "", //首页-总额度
	resAmt: "", //首页-可用额度
	waitRepay: "", //首页-当前待还金额
	waitDate: "" //授信-额度审核未通过且在限制期内--日期
};
const personCenterDatas = (state = personCenterInfo, action = {}) => {
	switch (action.type) {
		case PERSONCENTERS_DATAS:
			return objectAssign({}, state, action.options);
		default:
			return state;
	}
};
//获取设备信息
const paymentInfo = {
	payIndex: {
		//支付首页
		orderAmt: "", //待付款
		resAmt: "", //支付后剩余额度
		fltRate: "", //手续费（率）
		overdueAmt: "", //逾期费（率）
		date: "", //还款日期
		payAmt: "", //应还总额
		serviceAmt: "", //手续费
		phoneNum: "" //手机号
	},
	payLack: {
		//额度不足
		orderAmt: "",
		surplusAmt: ""
	},
	payNoSupport: {
		//暂不支持
		orderAmt: "",
		surplusAmt: ""
	},
	paySuccess: {
		//支付成功
		orderAmt: "", //订单额度
		resAmt: "" //剩余额度
	}
};
const paymentDatas = (state = paymentInfo, action = {}) => {
	switch (action.type) {
		case PAYMENT_DATAS:
			return objectAssign({}, state, action.options);
		default:
			return state;
	}
};
//获取页面来源ID
const sourceInfo = {
	pageSourceId: "" //"1"支付 ;"2"个人中心
};
const getPageSourceId = (state = sourceInfo, action = {}) => {
	switch (action.type) {
		case PAGESOURCE_ID:
			return objectAssign({}, state, action.options);
		default:
			return state;
	}
};
export { personCenterDatas, paymentDatas, getPageSourceId };
